<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>函数</title>
</head>
<body>
    <script>
        function greet(){
            console.log("hello,world");
        }
        greet();
        function hello_with_return(){
            return "hello,world!-返回值"
        }
        let a =hello_with_return();
        console.log(a);
        function hello_with_params(name){
            console.log("hello,"+name);
        }
        hello_with_params("如花");

        let global_var='全局变量';
        function local_var_function(){
        let local_var='局部变量';
        console.log("函数内打印全局变量",+global_var);
        console.log("函数内打印局部变量",+local_var);
        }
        local_var_function();
    </script>
</body>
</html>